//Author: David Lo
//Date: 12/12/12
//References: Collide_Spikes.js
//Description: Collisions with spiked platforms will kill the player on contact,
// decrements Lives and updates Player Lives within PlayerPrefs
// restarts the level (retains the player score)

static var Lives : int = 3;
var myLevel : String;

function OnTriggerEnter(myCollider : Collider)
{
    if( collider.gameObject.name == "SpikedPlatform" )
    {
    	//Decrements player lives on death
    	Lives--;
    	PlayerPrefs.SetInt("Player Lives", Lives);
    	
    	//Restarts the level
    	Application.LoadLevel(myLevel);
	}
}

